package com.tsky.yyj.entity;

import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * 
 * @function：分类
 * @author: cainiao
 * @version 1.0
 * @time: 2013-6-10 上午10:24:32
 */
@Entity
@Table(name = "T_YYJ_Classify")
public class Classify {
	@Id
	private String id;
	private String name;// 分类名
	private String property = "0";// 0: 子节点  1：父节点
	@ManyToOne @JoinColumn(name = "pid")
	private Classify parent;
	@OneToMany(mappedBy = "parent")
	private Set<Classify> childs;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Classify getParent() {
		return parent;
	}

	public void setParent(Classify parent) {
		this.parent = parent;
	}

	public Set<Classify> getChilds() {
		return childs;
	}

	public void setChilds(Set<Classify> childs) {
		this.childs = childs;
	}

	public String getProperty() {
		return property;
	}

	public void setProperty(String property) {
		this.property = property;
	}
	
}
